import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../user/LoginView.vue'
import FileView from '@/components/FileView.vue'
import RegisterView from '@/user/RegisterView.vue'
import ReceiveView from '@/user/ReceiveView'
// import store from '@/store'

const routes = [
  {
    path: "/",
    name: "home",
    redirect: "/login/",
    meta: {
      requestAuth: false
    }
  },
  {
    path: "/download/",
    name: "ReceiveView",
    component: ReceiveView,
    meta: {
      requestAuth: true
    }
  },
  {
    path: "/login/",
    name: "LoginView",
    component: LoginView,
    meta: {
      requestAuth: false
    }
  },
  {
    path: "/file/",
    name: "HomeView",
    component: FileView,
    meta: {
      requestAuth: true
    }
  },
  {
    path: "/register/",
    name: "Register",
    component: RegisterView,
    meta: {
      requestAuth: false
    }
  }
]


const router = createRouter({
  history: createWebHistory(),
  routes
})
export default router
